Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON schemas for data objects #756

Merged
merged 85 commits into from
Oct 17, 2023
Merged

Conversation

johnbillion
Copy link
Owner

@johnbillion johnbillion commented Apr 15, 2023

Maintaining the TypeScript interfaces separately from the PHP DTOs is risky as they may diverge.

This introduces a JSON schema for each DTO which used as the source of truth. These are then used to build the TypeScript interfaces used for the panel component props and to build the PHP DTO classes. As a bonus we also have usable JSON schemas for the data.

To build the interfaces and PHP classes:

npm run build-schemas

Progress

  • admin
  • assets
  • block_editor
  • cache
  • caps
  • conditionals
  • db_callers
  • db_components
  • db_dupes
  • db_queries
  • doing_it_wrong
  • environment
  • hooks
  • http
  • languages
  • logger
  • multisite
  • overview
  • php_errors
  • raw_request
  • redirects
  • request
  • theme
  • timing
  • transients

@johnbillion johnbillion marked this pull request as draft April 15, 2023 23:52
# Conflicts:
#	collectors/http.php
#	data/http.php
#	package.json
# Conflicts:
#	collectors/block_editor.php
#	data/db_queries.php
@johnbillion johnbillion merged commit 36b814f into client-side-rendering Oct 17, 2023
0 of 30 checks passed
@johnbillion johnbillion deleted the json-schemas branch October 17, 2023 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant